﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DrugStore.FormCollect;

namespace DrugStore.FormCollect
{
    public partial class MainFormBanHang : Form
    {
        private static log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
        private static DanhMucNhaCungCap fr_NhaCungCap;
        private static DanhMucNhaSanXuat fr_NhaSanXuat;
        private static DanhMucNhomHangHoa fr_NhomHangHoa;
        private static DanhMucDonViHangHoa fr_NhomDonViHangHoa;

        private static Xuat_BanTheoToaKhach fr_BanTheoToaKhach;
        private static Xuat_BanTheoToaPhongKham fr_BanTheoToaPhongKham;
        private static Xuat_BanTheoYeuCauKhach fr_BanTheoYeuCauKhach;
        private static Xuat_Huy fr_XuatHuy;

        private static NhapHang fr_NhapHang;

        private static BaoCaoDoanhSo fr_BaoCaoDoanhSo;
        private static BaoCaoTonKho fr_BaoCaoTonKho;

        private static GioiThieu fr_GioiThieu;
        private static HuongDanSuDung fr_HuongDanSuDung;

        private static QuanLyNguoiSuDung fr_QuanLyNguoiSuDung;

        private static TaoToaThuocMau fr_TaoToaThuocMau;
        private static LogOn fr_LogOn;
 

        public MainFormBanHang()
        {
            InitializeComponent();
            this.TopMost = true;
        }

        private void MainForm_Load(object sender, EventArgs e)
        {

        }

        private void hàngHóaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            fr_NhomHangHoa = new DanhMucNhomHangHoa();
            fr_NhomHangHoa.MdiParent = this;
            fr_NhomHangHoa.Show();
        }
                
        private void nhàCungCấpToolStripMenuItem_Click(object sender, EventArgs e)
        {
            fr_NhaCungCap = new DanhMucNhaCungCap();
            fr_NhaCungCap.MdiParent = this;
            fr_NhaCungCap.Show();
        }

        private void nhàSảnXuấtToolStripMenuItem_Click(object sender, EventArgs e)
        {
            fr_NhaSanXuat = new DanhMucNhaSanXuat();
            fr_NhaSanXuat.MdiParent = this;
            fr_NhaSanXuat.Show();
        }

        private void đơnVịHàngHóaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            fr_NhomDonViHangHoa = new DanhMucDonViHangHoa();
            fr_NhomDonViHangHoa.MdiParent = this;
            fr_NhomDonViHangHoa.Show();
        }

        private void bánTheoToaPhòngKhámToolStripMenuItem_Click(object sender, EventArgs e)
        {
            fr_BanTheoToaPhongKham = new Xuat_BanTheoToaPhongKham();
            fr_BanTheoToaPhongKham.MdiParent = this;
            fr_BanTheoToaPhongKham.Show();
        }

        private void bánTheoToaNgườiMuaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            fr_BanTheoToaKhach = new Xuat_BanTheoToaKhach();
            fr_BanTheoToaKhach.MdiParent = this;
            fr_BanTheoToaKhach.Show();
        }

        private void bánTheoYêuCầuToolStripMenuItem_Click(object sender, EventArgs e)
        {
            fr_XuatHuy = new Xuat_Huy();
            fr_XuatHuy.MdiParent = this;
            fr_XuatHuy.Show();
        }

        private void nhậpHàngToolStripMenuItem_Click(object sender, EventArgs e)
        {
            fr_NhapHang = new NhapHang();
            fr_NhapHang.MdiParent = this;
            fr_NhapHang.Show();
        }

        private void doanhThuToolStripMenuItem_Click(object sender, EventArgs e)
        {
            fr_BaoCaoDoanhSo = new BaoCaoDoanhSo();
            fr_BaoCaoDoanhSo.MdiParent = this;
            fr_BaoCaoDoanhSo.Show();
        }

        private void tồnKhoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            fr_BaoCaoTonKho = new BaoCaoTonKho();
            fr_BaoCaoTonKho.MdiParent = this;
            fr_BaoCaoTonKho.Show();
        }

        private void giớiThiệuToolStripMenuItem_Click(object sender, EventArgs e)
        {
            fr_GioiThieu = new GioiThieu();
            fr_GioiThieu.MdiParent = this;
            fr_GioiThieu.Show();
        }

        private void hướngDẫnSửDụngToolStripMenuItem_Click(object sender, EventArgs e)
        {
            fr_HuongDanSuDung = new HuongDanSuDung();
            fr_HuongDanSuDung.MdiParent = this;
            fr_HuongDanSuDung.Show();
        }

        private void ngườiDùngToolStripMenuItem_Click(object sender, EventArgs e)
        {
            fr_QuanLyNguoiSuDung = new QuanLyNguoiSuDung();
            fr_QuanLyNguoiSuDung.MdiParent = this;
            fr_QuanLyNguoiSuDung.Show();
        }

        private void nhậpHàngToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            fr_NhapHang = new NhapHang();
            fr_NhapHang.MdiParent = this;
            fr_NhapHang.Show();
        }

        private void thoátToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void tạoToaThuốcMẫuToolStripMenuItem_Click(object sender, EventArgs e)
        {
            fr_TaoToaThuocMau = new TaoToaThuocMau();
            fr_TaoToaThuocMau.MdiParent = this;
            fr_TaoToaThuocMau.Show();
        }

        private void kiểu1ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.LayoutMdi(System.Windows.Forms.MdiLayout.Cascade);
        }

        private void kiểu2ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.LayoutMdi(System.Windows.Forms.MdiLayout.ArrangeIcons);
        }

        private void kiểu3ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.LayoutMdi(System.Windows.Forms.MdiLayout.TileHorizontal);
        }

        private void kiểu4ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.LayoutMdi(System.Windows.Forms.MdiLayout.TileVertical);
        }

        private void MainFormBanHang_FormClosing(object sender, FormClosingEventArgs e)
        {
            // Confirm user wants to close
            switch (MessageBox.Show(this, "Bạn có chắc đã hoàn thành xong công việc?", "Thoát chương trình", MessageBoxButtons.YesNo))
            {
                case DialogResult.No:
                    e.Cancel = true;
                    break;
                default:
                    break;
            }        
        }
    }
}
